package com.itheima.mRadix.demo;

public class Demo2Array {
    public static void main(String[] args) {
        //1.遍历二维数组,取出里面每一个一维数组
        int[][] arr = {{22,33,44}, {33,44,55},{25,45,65}};
        System.out.println("----------------");
        int sum = 0;
        int max = arr[0][0];
        for (int i = 0; i < arr.length; i++) {

            //在遍历的过程中,对每一个一维数组继续完成遍历
            for (int j = 0; j < arr.length; j++) {
                System.out.println(arr[i][j]);
                sum += arr[i][j];

                if(arr[i][j] > max){
                    max = arr[i][j];
                }
            }System.out.println("----------------");
        }
        System.out.println("sum =" + sum);
        System.out.println("max = " + max);
    }
}
